const { Sequelize } = require('sequelize');

// 数据库配置
const sequelize = new Sequelize('lingxi_system', 'root', '888mei525', {
  host: 'localhost',
  dialect: 'mysql',
  timezone: '+08:00',
  logging: false
});

async function checkTable() {
  try {
    await sequelize.authenticate();
    console.log('数据库连接成功');
    
    const [results] = await sequelize.query('DESCRIBE sales_orders');
    console.log('sales_orders表结构:');
    results.forEach(row => {
      console.log(`${row.Field}: ${row.Type} ${row.Null === 'YES' ? 'NULL' : 'NOT NULL'} ${row.Key} ${row.Default || ''}`);
    });
    
    await sequelize.close();
  } catch (error) {
    console.error('错误:', error.message);
  }
}

checkTable();